---
title: Reddit Tools
---

## Code

```python cookbook/tools/reddit_tools.py
from agno.agent import Agent
from agno.tools.reddit import RedditTools

agent = Agent(
    instructions=[
        "You are a Reddit content analyst that helps explore and understand Reddit data",
        "Browse subreddits, analyze posts, and provide insights about discussions",
        "Respect Reddit's community guidelines and rate limits",
    ],
    tools=[RedditTools()],
    markdown=True,
)

agent.print_response("Show me the top posts from r/technology today")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your credentials">
    ```bash
    export REDDIT_CLIENT_ID=your-reddit-client-id
    export REDDIT_CLIENT_SECRET=your-reddit-client-secret
    export REDDIT_USER_AGENT=YourApp/1.0
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash
    pip install -U praw openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/tools/reddit_tools.py
    ```

    ```bash Windows
    python cookbook/tools/reddit_tools.py
    ```
    </CodeGroup>
  </Step>
</Steps>
